libs = user32.lib gdi32.lib kernel32.lib comctl32.lib

!message nmake usage:
!message 'nmake'                   : build debug version.
!message 'nmake release='          : build release version.
!message 'nmake clean'             : clean workshop
!message

lkf = /nologo
lbf = /nologo
mtf = -nologo

!ifdef release
clf = /nologo /c /MD /DNDEBUG
!else
clf = /nologo /c /MD
!endif

!ifdef release
all : msg_mark_r.dll t.exe
!else
all : msg_mark_d.dll t.exe
!endif


!ifdef release
msg_mark_r.dll : msg_mark_r.obj msg_mark_r.exp
!else
msg_mark_d.dll : msg_mark_d.obj msg_mark_d.exp
!endif
	link $(lkf) /out:$@ /dll $**
	@if exist $*.dll.manifest (mt $(mtf) -manifest $*.dll.manifest -outputresource:$*.dll;2 & del $*.dll.manifest)


!ifdef release
msg_mark_r.exp : msg_mark_r.obj
!else
msg_mark_d.exp : msg_mark_d.obj
!endif
	lib $(lbf) /def $**



!ifdef release
msg_mark_r.obj : msg_mark.c
!else
msg_mark_d.obj : msg_mark.c
!endif
	cl $(clf) /Fo$@ /Ddynamic $**


t.exe : t.obj
	link $(lkf) $** \
!ifdef release
	msg_mark_r.lib
!else
	msg_mark_d.lib
!endif
	@if exist $*.exe.manifest (mt $(mtf) -manifest $*.exe.manifest -outputresource:$*.exe & del $*.exe.manifest)



t.obj : t.c
	cl $(clf) t.c



clean:
	if exist *.obj (del *.obj)
	if exist *.exe (del *.exe)
	if exist *.dll (del *.dll)
	if exist *.manifest (del *.manifest)
	if exist *.res (del *.res)
	if exist *.exp (del *.exp)
	if exist *.lib (del *.lib)
	if exist *.txt (del *.txt)
